package com.example.demo.service.model;

import com.example.demo.entity.OrderItem;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.List;

/**
 * @author chenqiuran
 * @decription service层的返回值
 * @date 2021/8/27
 */
@Service
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value="order模型对象",description="订单模型")
public class OrderModel implements Serializable {
    private static final long serialVersionUID = -1241360949457314498L;

    @ApiModelProperty(value="订单id",name="id",example="15")
    private Long id;

    @ApiModelProperty(value = "用户id",name = "userId",example = "1001")
    private Long userId;

    @ApiModelProperty(value = "时间",name = "date",example = "2021-08-29 10:11:13.50")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Timestamp date;


    //订单生成后为0    未付款
    //订单付款后变为1  已付款
    //商家发货后变为2  未发货
    //用户确认后变为3  订单完成
    @ApiModelProperty(value = "状态",name = "state",example = "0")
    private Integer state;

    @ApiModelProperty(value = "备注",name = "notes",example = "麻婆豆腐少放盐")
    private String notes;

    @ApiModelProperty(value = "总价",name = "totalPrice",example = "15.25")
    private BigDecimal totalPrice;

    @ApiModelProperty(value = "订单项集合",name = "orderItemList",example = "")
    private List<OrderItem> orderItemList;

    @ApiModelProperty(value = "订单状态",name = "isDelete",example = "0")
    private Byte isDelete;
}
